<page-header title="权益管理" [breadcrumb]="breadcrumb" [action]="action">
  <ng-template #breadcrumb>
    <ql-breadcrumb>
      <ql-breadcrumb-item>营销管理</ql-breadcrumb-item>
      <ql-breadcrumb-item>权益管理</ql-breadcrumb-item>
    </ql-breadcrumb>
  </ng-template>
  <ng-template #action>
    <ql-button type="primary" [routerLink]="['/marketing/equities-create']">新增权益</ql-button>
  </ng-template>
</page-header>
<page-container>

  <data-form [showReset]="false" [formGroup]="formGroup" (submit)="onRefresh()" >
    <ql-form-item   label="权益名称: ">
      <ql-input></ql-input>
    </ql-form-item>
    <ql-form-item label="提供服务商: " label-width="150">
      <ql-select placeholder="请选择">
      <ql-option *ngFor="let item of provideCompany"
                 [label]="item.key"
                 [value]="item.value">
      </ql-option>
      </ql-select>
    </ql-form-item>
    <ql-form-item label="可用数量: " >
     <ql-input></ql-input>
    </ql-form-item>
    <ql-form-item label="权益种类: ">
      <ql-select>
        <ql-option *ngFor="let item of equitiesTypes"
                   [label]="item.key"
                   [value]="item.value">
        </ql-option>
      </ql-select>
    </ql-form-item>
    <ql-form-item label="到期时间: ">
      <ql-date-picker></ql-date-picker>
    </ql-form-item>
  </data-form>
  <data-table [model]="qeuitiesData">
    <ql-table-column model-key="type" label="权益类型"></ql-table-column>
    <ql-table-column model-key="name" label="权益名称"></ql-table-column>
    <ql-table-column model-key="chargeOffType" label="核销方式"></ql-table-column>
    <ql-table-column model-key="company" label="提供服务商"></ql-table-column>
    <ql-table-column model-key="upTime" label="上架时间"></ql-table-column>
    <ql-table-column model-key="count" label="权益总数量"></ql-table-column>
    <ql-table-column model-key="lastCount" label="剩余可用数量"></ql-table-column>
    <ql-table-column model-key="expireTime" label="到期时间"></ql-table-column>
    <ql-table-column label="操作" width="200" >
      <ng-template #slot let-scope="scope">
        <ql-button type="text" (click)="putAway(scope.rowData.id)" >上架</ql-button>
        <ql-button type="text" (click)="cease(scope.rowData.id)" >停用</ql-button>
        <ql-button type="text" (click)="delete(scope.rowData.id)">删除</ql-button>
        <ql-button type="text" (click)="checkDetail(scope.rowData.id)">查看详情</ql-button>
      </ng-template>
    </ql-table-column>
  </data-table>
</page-container>
